import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import './assets/css/index.css'

import axios from 'axios'
axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1/'
Vue.prototype.$http = axios

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

Vue.config.productionTip = false

axios.interceptors.request.use((config) => {
	var arr = JSON.parse(sessionStorage.getItem('list'))
	var token
	if (arr) {
		token = arr.token
	} else {
		token = null
	}
	config.headers.Authorization = token
	return config
})

new Vue({
	router,
	store,
	render: (h) => h(App),
}).$mount('#app')
